package com.bootdo.clouddo.utils.douban;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class DbBookUtil {

    private static Random random = new Random();

    private static List<Long> bookIds = new ArrayList<>();

    public static Long getRandomId(){
        if(bookIds == null || bookIds.isEmpty())
            return -1L;
        return bookIds.get(random.nextInt(bookIds.size()));
    }

    public static void setBookIds(List<Long> bookIds) {
        DbBookUtil.bookIds = bookIds;
    }
}
